package 蓝桥杯;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class P0203 {

    public static int isVid(String str) {
        for(int i = 0 ; i < str.length() ; i++) {
            if(str.charAt(i) == '#') {
                return i;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        Scanner s1 = new Scanner(System.in);
        List<String> list = new ArrayList<>();
        while (true) {
            String str = s1.nextLine();
            int vid = isVid(str);
            if(vid != -1) {
                list.add(str.substring(0 , vid));
                break;
            }
            list.add(str);
        }
        int a = 0 , b = list.size() - 1 , sum = 0;
        for (String str : list) {
            sum += str.length();
            for(char c : str.toCharArray()) {
                if(c == ' ') {
                    a++;
                }
            }
        }
        System.out.println(a + " " + b + " " + (sum - a));

    }

}
